package 作业文件.代码块作业;

abstract class Shape {
    public  abstract  void  Mianji(int chang,int height );
}
class One {
    public static void main(String[] args) {
        Shape  Rectangle = new Shape() {
            @Override
            public void Mianji(int chang, int height) {
                System.out.println( "矩形面积是"+chang*height);
            }
        };
        Rectangle.Mianji(10,10);
        Shape  triangle = new Shape() {
            @Override
            public void Mianji(int chang, int height) {
                System.out.println( "三角面积是"+chang*height/2);
            }
        };
        triangle.Mianji(10,10);
    }
}